from headline.models import News,Category
from users.models import User
import random


for i in range(1,100):
    user_or_news_get_id = random.randint(1, 3)
    news = News.objects.get(id=user_or_news_get_id)
    user = User.objects.get(id=user_or_news_get_id)
    categories_list = Category.objects.all()
    categories_num = random.randint(0,6)
    catego = categories_list[categories_num]
    news.id = None
    news.user = user
    news.category = catego
    name = random.choice(["马云","马化腾","王健林","许家印"])
    news.title = "%s---%04d收购澳洲最大燃气公司受阻海外投资4800亿曾被批'跑路'" % (name,i)
    news.save()
